package com.jiangcheng.demo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author admin
 * @since 2021-07-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("文章")
@AllArgsConstructor
public class Article implements Serializable {

    private static final long serialVersionUID=1L;
    public Article(){}

    @TableId(value = "art_id",type= IdType.AUTO)
    @ApiModelProperty("文章ID")
    private Integer artId;

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("文章富文本内容")
    private String content;

    @ApiModelProperty("作者ID")
    private Integer authorId;

    @ApiModelProperty("评论数量")
    private Integer commentCount;

    @ApiModelProperty("当前用户是否点赞")
    private Integer isPublic;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",  locale = "zh" ,timezone="GMT+8")
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

//    @TableField(fill = FieldFill.INSERT_UPDATE) //添加和修改的时候也执行
    @ApiModelProperty("更改时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("文章图片路径")
    private String articlePic;

    @ApiModelProperty("文章内容文本")
    private String contentText;

}
